/*package com.dwork.base.controller.scanning;

import java.lang.reflect.Method;
import java.util.Set;

import org.reflections.Reflections;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.gdtopway.mc.dao.ResourcesBeDao;
import com.gdtopway.mc.entity.ResourcesBe;
import com.gdtopway.mc.service.ResourcesBeService;

//创建的类名根据需要定义，但一定要实现ServletContextListener接口 
public class WebContextListener {
	@Autowired
	ResourcesBeDao resourcesBeDao;
	@Autowired
	ResourcesBeService resourcesBeService;

	public void contextInitialized() {

		ResourcesBe resourcesBe = new ResourcesBe();
		Reflections reflections = new Reflections("com.gdtopway.tagg.controller");
		Set<Class<?>> classesList = reflections.getTypesAnnotatedWith(Controller.class);
		// this.resourcesBeService.delResourcesBe();
		this.resourcesBeService.delTemResourcesBe();
		for (Class classes : classesList) {
			// classes.getAnnotation(RequestMapping.class);
			// 得到该类下面的所有方法
			Method[] methods = classes.getDeclaredMethods();
			// classes.getName();
			// classes.getSimpleName();
			try {
				RequestMapping a = (RequestMapping) classes.getAnnotation(RequestMapping.class);
				String[] valueArr = a.value();
				String value = "";
				for (String each : valueArr) {
					value += each;
				}
				if (a != null) {
					// 清空表数据

					resourcesBe.setGroupName(a.name());
					resourcesBe.setName(a.name());
					resourcesBe.setValue(value);
					// resourcesBeService.save(resourcesBe);
					resourcesBeService.saveTemResourcesBe(resourcesBe);
					for (Method method : methods) {
						// 得到该类下面的Tagg注解
						// Tagg taggs = method.getAnnotation(Tagg.class);
						RequestMapping taggs = method.getAnnotation(RequestMapping.class);
						String[] valueArrr = taggs.value();
						String values = "";
						for (String each : valueArrr) {
							values += each;
						}
						// (RequestMapping)classes.getAnnotation(RequestMapping.class);
						if (null != taggs) {
							ResourcesBe resourcesBes = new ResourcesBe();
							resourcesBes.setGroupId(value);
							resourcesBes.setGroupName(a.name());
							resourcesBes.setName(taggs.name());
							resourcesBes.setValue(values);
							// resourcesBeService.save(resourcesBes);
							resourcesBeService.saveTemResourcesBe(resourcesBes);

						}
					}
				}

			} catch (SecurityException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}

			
		}
		//boolean an = this.resourcesBeService.minusList();
		this.resourcesBeService.insertMinus();
	}

}*/